package com.example.speeddating.mapper;

import com.example.speeddating.entity.TagType;
import com.example.speeddating.entity.Tags;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 *
 * @author tina
 * @since 2023-06-28 11:14:34
 */
@Mapper
public interface TagsMapper extends BaseMapper<Tags> {

    public List<Tags> allTags(int type);

    public int deleteTags(int tagId);

    public int updateTags(Tags tags);

    public int insertTags(Tags tags);

    @Select(value = "SELECT * FROM tags WHERE id IN (SELECT tag_id from user_tag WHERE user_id = #{id})")
    public List<Tags> selectUserTagsByUserId(Long id);

}
